package com.xframe.domain.role;

import com.xframe.domain.BaseModel;
import com.xframe.xdal.core.annotation.*;
import com.xframe.xdal.core.constant.AutoFillType;
import lombok.Data;
import lombok.experimental.Accessors;


/**
 * @Description: 菜单按钮关系
 * @ClassName: SysMenuButton
 * @Author: xufeng
 * @CreateTime: 2023/4/4 16:55
 **/
@Data
@Accessors(chain=true)
@XTable(value = "sys_menu_button", label = "菜单按钮关系")
@XBelongsTo(typeName = "com.xframe.domain.role.SysMenu",foreignKey = "menuId", targetKey = "menuId", as = "refSysMenu")
@XBelongsTo(typeName = "com.xframe.domain.role.SysButton",foreignKey = "buttonCode", targetKey = "buttonCode", as = "refButton")
public class SysMenuButton extends BaseModel {
    /**
     * 主键
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(name = "menu_button_id", primaryKeyFlag = true,desc = "主键")
    private Long menuButtonId;
    /**
     * 菜单表ID
     */
    @XColumn(name = "menu_id", uniqueFlag = true,desc = "菜单ID")
    private Long menuId;
    /**
     * 按钮编码
     */
    @XColumn(name = "button_code", uniqueFlag = true,desc = "按钮编码",length = 50)
    private String buttonCode;
    /**
     * 引用的菜单对象
     */
    private SysMenu refSysMenu;
    /**
     * 引用的按钮对象
     */
    private SysButton refButton;
}
